The routine ggDrawAxesTitle() provides a means to output a justified title with reference to either the X or Y axis:
ggDrawAxesTitle(string,yorx,xory,pos1,pos2)where string is a character variable or constant holding the title. xory determines the axis to which the title is related whereas pos1 & pos2 determines the vertical and horizontal justification within the limits of the current position and length of the specified axis.
For titles related to the X axis (xory = GXAXIS), yorx is the Y coordinate position in user space coordinates. Conversely for Y axis titles (xory = GYAXIS), yorx is the X coordinate position in user space coordinates. X axis titles are written to be read from left to right, and Y axis titles are written with the first character lowest.
As ggDrawAxesTitle() uses a user space coordinate to determine the position of the title, its use is not restricted to axis titling, but may be used for more general titling such as at the top of a graph or even to label a point of interest within a graph. Where the position needs to be related to some point on the graphical coordinate system it may be necessary to convert between a graphical and space coordinates system in order to supply the value of yorx. This can be achieved with the utility routine ggTransformGraphPoint().
An example of the use of ggDrawAxesTitle() is shown below, displaying the interaction of yorx, xory, pos1 & pos2 with reference to the X axis.
![]() |
Titling Parameters |